{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas_datareader as pdr\n",
    "alibaba = pdr.get_data_yahoo('BABA')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Adj Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2014-09-19</th>\n",
       "      <td>92.699997</td>\n",
       "      <td>99.699997</td>\n",
       "      <td>89.949997</td>\n",
       "      <td>93.889999</td>\n",
       "      <td>93.889999</td>\n",
       "      <td>271879400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-09-22</th>\n",
       "      <td>92.699997</td>\n",
       "      <td>92.949997</td>\n",
       "      <td>89.500000</td>\n",
       "      <td>89.889999</td>\n",
       "      <td>89.889999</td>\n",
       "      <td>66657800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-09-23</th>\n",
       "      <td>88.940002</td>\n",
       "      <td>90.480003</td>\n",
       "      <td>86.620003</td>\n",
       "      <td>87.169998</td>\n",
       "      <td>87.169998</td>\n",
       "      <td>39009800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-09-24</th>\n",
       "      <td>88.470001</td>\n",
       "      <td>90.570000</td>\n",
       "      <td>87.220001</td>\n",
       "      <td>90.570000</td>\n",
       "      <td>90.570000</td>\n",
       "      <td>32088000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2014-09-25</th>\n",
       "      <td>91.089996</td>\n",
       "      <td>91.500000</td>\n",
       "      <td>88.500000</td>\n",
       "      <td>88.919998</td>\n",
       "      <td>88.919998</td>\n",
       "      <td>28598000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 Open       High        Low      Close  Adj Close     Volume\n",
       "Date                                                                        \n",
       "2014-09-19  92.699997  99.699997  89.949997  93.889999  93.889999  271879400\n",
       "2014-09-22  92.699997  92.949997  89.500000  89.889999  89.889999   66657800\n",
       "2014-09-23  88.940002  90.480003  86.620003  87.169998  87.169998   39009800\n",
       "2014-09-24  88.470001  90.570000  87.220001  90.570000  90.570000   32088000\n",
       "2014-09-25  91.089996  91.500000  88.500000  88.919998  88.919998   28598000"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alibaba.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(789, 6)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alibaba.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Adj Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-10-30</th>\n",
       "      <td>178.429993</td>\n",
       "      <td>181.899994</td>\n",
       "      <td>177.589996</td>\n",
       "      <td>181.580002</td>\n",
       "      <td>181.580002</td>\n",
       "      <td>20219700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-10-31</th>\n",
       "      <td>183.570007</td>\n",
       "      <td>185.119995</td>\n",
       "      <td>181.811005</td>\n",
       "      <td>184.889999</td>\n",
       "      <td>184.889999</td>\n",
       "      <td>21256700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-01</th>\n",
       "      <td>187.880005</td>\n",
       "      <td>188.880005</td>\n",
       "      <td>183.580002</td>\n",
       "      <td>186.080002</td>\n",
       "      <td>186.080002</td>\n",
       "      <td>28594700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-02</th>\n",
       "      <td>190.990005</td>\n",
       "      <td>191.220001</td>\n",
       "      <td>183.309998</td>\n",
       "      <td>184.809998</td>\n",
       "      <td>184.809998</td>\n",
       "      <td>41239900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-03</th>\n",
       "      <td>186.509995</td>\n",
       "      <td>186.929993</td>\n",
       "      <td>182.059998</td>\n",
       "      <td>183.210007</td>\n",
       "      <td>183.210007</td>\n",
       "      <td>19621400</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                  Open        High         Low       Close   Adj Close  \\\n",
       "Date                                                                     \n",
       "2017-10-30  178.429993  181.899994  177.589996  181.580002  181.580002   \n",
       "2017-10-31  183.570007  185.119995  181.811005  184.889999  184.889999   \n",
       "2017-11-01  187.880005  188.880005  183.580002  186.080002  186.080002   \n",
       "2017-11-02  190.990005  191.220001  183.309998  184.809998  184.809998   \n",
       "2017-11-03  186.509995  186.929993  182.059998  183.210007  183.210007   \n",
       "\n",
       "              Volume  \n",
       "Date                  \n",
       "2017-10-30  20219700  \n",
       "2017-10-31  21256700  \n",
       "2017-11-01  28594700  \n",
       "2017-11-02  41239900  \n",
       "2017-11-03  19621400  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alibaba.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Adj Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>789.000000</td>\n",
       "      <td>789.000000</td>\n",
       "      <td>789.000000</td>\n",
       "      <td>789.000000</td>\n",
       "      <td>789.000000</td>\n",
       "      <td>7.890000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>98.879004</td>\n",
       "      <td>99.977879</td>\n",
       "      <td>97.622681</td>\n",
       "      <td>98.800431</td>\n",
       "      <td>98.800431</td>\n",
       "      <td>1.681925e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>29.076254</td>\n",
       "      <td>29.240037</td>\n",
       "      <td>28.743547</td>\n",
       "      <td>29.007961</td>\n",
       "      <td>29.007961</td>\n",
       "      <td>1.427472e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>57.299999</td>\n",
       "      <td>58.650002</td>\n",
       "      <td>57.200001</td>\n",
       "      <td>57.389999</td>\n",
       "      <td>57.389999</td>\n",
       "      <td>3.775300e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>79.849998</td>\n",
       "      <td>80.989998</td>\n",
       "      <td>79.150002</td>\n",
       "      <td>79.889999</td>\n",
       "      <td>79.889999</td>\n",
       "      <td>1.003060e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>89.099998</td>\n",
       "      <td>90.459999</td>\n",
       "      <td>88.059998</td>\n",
       "      <td>88.900002</td>\n",
       "      <td>88.900002</td>\n",
       "      <td>1.340540e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>106.500000</td>\n",
       "      <td>107.550003</td>\n",
       "      <td>105.129997</td>\n",
       "      <td>105.980003</td>\n",
       "      <td>105.980003</td>\n",
       "      <td>1.915080e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>190.990005</td>\n",
       "      <td>191.220001</td>\n",
       "      <td>183.580002</td>\n",
       "      <td>186.080002</td>\n",
       "      <td>186.080002</td>\n",
       "      <td>2.718794e+08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Open        High         Low       Close   Adj Close  \\\n",
       "count  789.000000  789.000000  789.000000  789.000000  789.000000   \n",
       "mean    98.879004   99.977879   97.622681   98.800431   98.800431   \n",
       "std     29.076254   29.240037   28.743547   29.007961   29.007961   \n",
       "min     57.299999   58.650002   57.200001   57.389999   57.389999   \n",
       "25%     79.849998   80.989998   79.150002   79.889999   79.889999   \n",
       "50%     89.099998   90.459999   88.059998   88.900002   88.900002   \n",
       "75%    106.500000  107.550003  105.129997  105.980003  105.980003   \n",
       "max    190.990005  191.220001  183.580002  186.080002  186.080002   \n",
       "\n",
       "             Volume  \n",
       "count  7.890000e+02  \n",
       "mean   1.681925e+07  \n",
       "std    1.427472e+07  \n",
       "min    3.775300e+06  \n",
       "25%    1.003060e+07  \n",
       "50%    1.340540e+07  \n",
       "75%    1.915080e+07  \n",
       "max    2.718794e+08  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alibaba.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "DatetimeIndex: 789 entries, 2014-09-19 to 2017-11-03\n",
      "Data columns (total 6 columns):\n",
      "Open         789 non-null float64\n",
      "High         789 non-null float64\n",
      "Low          789 non-null float64\n",
      "Close        789 non-null float64\n",
      "Adj Close    789 non-null float64\n",
      "Volume       789 non-null int64\n",
      "dtypes: float64(5), int64(1)\n",
      "memory usage: 43.1 KB\n"
     ]
    }
   ],
   "source": [
    "alibaba.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
